home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compendium Deluxe 2
/
LSD and 17bit Compendium Deluxe - Volume II.iso
/
a
/
prog
/
asmsrc
/
sparkint.lha
/
MUSOK.S
Wrap
Text File
|
1987-01-01
|
14KB
|
943 lines
; copper list example
;
bwobflag: dc.w 0
execbase: equ 4
dmacon: equ $dff096
oldopenlibary: equ -408
main: move.l execbase,a6
lea gfxname,a1
move.l #0,d0
jsr oldopenlibary(a6)
tst d0
beq error_no_libary
move.l d0,gfxbase
move.l d0,a0
add.l #$32,a0
move.w #$0080,dmacon
move.l (a0),oldcopper
move.l #newcopper,(a0)
move.w #$8080,dmacon
bsr scrapsetup
jsr mt_init
move.w #$0020,$dff096
move.w #$4000,$dff09a
move.l $6c,store
move.l #inter,$6c
move.w #$c000,$dff09a
wait: andi.b #$40,$bfe001
bne wait
move.w #$000f,$dff096
move.w #$4000,$dff09a
move.l store,$6c
move.w #$c000,$dff09a
clr.l d0
;jsr start
move.l gfxbase,a0
add.l #$32,a0
move.w #$8020,$dff096
move.w #$0080,dmacon
move.l oldcopper,(a0)
move.w #$8080,dmacon
error_no_libary:
rts
gfxname:
dc.b "graphics.library",0
even
inter: jsr mt_music
bsr scraper
dc.w $4ef9
store: dc.l 0
textup: move.l #$71000,a5
move.w #20,d7
nextch: addq.l #2,a5
move.l a5,a0
move.l #$70000,a1
bsr getcharval
move.l chart,d3
add.l d3,a1
move.w #20,d0
pbit: move.w (a1)+,(a0)
add.l #$5c,a0
dbr d0,pbit
dbr d7,nextch
rts
textpoint: dc.l 0,0
ss: dc.b 0
sstore: dc.b 0,0,0
chart: dc.w 0
char: dc.w 0,0,0
getcharval:
lea text,a6
move.l textpoint,d0
add.l d0,a6
move.b (a6),d0
cmp.w #$ff,d0
beq resetall
move.b d0,sstore
move.w ss,d0
sub.w #$31,d0
mulu #$20,d0
move.w d0,char
addq.l #1,textpoint
rts
RESETALL:
move.l #0,textpoint
bra getcharval
text: DC.B ` SPARK `
dc.b `OF XXX INTERNATIONAL `
DC.B ` PRESENTS `
DC.B ` THE XXX INTRO `
DC.B ` ALL CODING BY SPARK `
DC.B ` GRAFIX BY TURBO `
DC.B ` MUSIC BY SPARK `
DC.B ` THIS MESSAGE IS A `
DC.B ` LOAD OF SHIT `
DC.B ` SO I THINK I WILL GO`
DC.B ` BYE BYE SUCKERS `
DC.B ` `,$FF
EVEN
scrapsetup:
lea xbps,a1
lea xbpf,a2
move.w #$FD2,d0
suloop: move.w d0,(a1)
add.w #$5c,d0
add.l #16,a1
cmp.l a1,a2
bgt suloop
rts
tablepo: dc.b 0,0
tablepos: dc.b 0,0,0,0
scraper:
lea xbps,a1
lea xscs,a4
lea xscf-16,a5
repbit: move.w 16(a1),d0
sub.w #$5c,d0
move.w d0,(a1)
move.w 16(a4),(a4)
add.l #16,a4
add.l #16,a1
cmp.l a4,a5
bgt repbit
;newvalue
move.l tablepo,d0
lea wobtable,a4
add.l d0,a4
lea xbpf-16,a1
lea xscf-16,a3
wobloop:
bsr nextwob
add.l #2,d0
lea wobtable,a4
add.l d0,a4
move.l d0,tablepo
cmp.w #$abcd,(a4)
beq ressit
rts
ressit:
lea wobtable,a4
move.l #0,tablepo
bsr textup
nextwob:
cmp.w #$abcd,(a4)
beq ressit
move.w (a4),d1
cmp.w #$e000,d1
bhi suber
adder: move.w (a3),d2
add.w d1,d2
cmp.w #$ff,d2
bhi addone
move.w d2,(a3)
rts
addone: sub.w #$10,d2
move.w d2,d1s
move.b #0,d1s
move.w d1s,d2
move.w d2,(a3)
sub.w #2,(a1)
rts
suber: move.w (a3),d2
add.w d1,d2
cmp.w #$f000,d2
bhi subone
move.w d2,(a3)
rts
subone: add.w #$10,d2
move.w d2,d1s
move.b #0,d1s
move.w d1s,d2
move.w d2,(a3)
add.w #2,(a1)
rts
d1s: dc.b 0
d1store:dc.b 0
wobtable:
blk.w 5,-$11
blk.w 5,-$22
blk.w 5,-$33
blk.w 5,-$44
blk.w 5,-$55
blk.w 6,-$66
blk.w 5,-$77
blk.w 5,-$88
blk.w 5,-$99
blk.w 6,-$aa
blk.w 8,-$BB
blk.w 100,-$00
BLK.W 2,-$55
BLK.W 2,-$44
BLK.W 2,-$33
BLK.W 2,-$22
BLK.W 2,-$11
BLK.W 2,00
BLK.W 2,$11
BLK.W 2,$22
BLK.W 2,$33
BLK.W 2,$44
BLK.W 2,$55
BLK.W 2,$55
BLK.W 2,$44
BLK.W 2,$33
BLK.W 2,$22
BLK.W 2,$11
BLK.W 2,00
BLK.W 2,-$11
BLK.W 2,-$22
BLK.W 2,-$33
BLK.W 2,-$44
BLK.W 2,-$55
BLK.W 2,-$55
BLK.W 2,-$44
BLK.W 2,-$33
BLK.W 2,-$22
BLK.W 2,-$11
BLK.W 2,00
BLK.W 2,$11
BLK.W 2,$22
BLK.W 2,$33
BLK.W 2,$44
BLK.W 2,$55
BLK.W 2,$55
BLK.W 2,$44
BLK.W 2,$33
BLK.W 2,$22
BLK.W 2,$11
BLK.W 2,00
BLK.W 2,-$11
BLK.W 2,-$22
BLK.W 2,-$33
BLK.W 2,-$44
BLK.W 2,-$55
BLK.W 50,0
BLK.W 30,-$11
BLK.W 30,$11
BLK.W 30,$11
BLK.W 30,-$11
BLK.W 50,0
BLK.W 2,$55
BLK.W 2,$44
BLK.W 2,$33
BLK.W 2,$22
BLK.W 2,$11
BLK.W 2,00
BLK.W 2,-$11
BLK.W 2,-$22
BLK.W 2,-$33
BLK.W 2,-$44
BLK.W 2,-$55
BLK.W 2,-$55
BLK.W 2,-$44
BLK.W 2,-$33
BLK.W 2,-$22
BLK.W 2,-$11
BLK.W 2,00
BLK.W 2,$11
BLK.W 2,$22
BLK.W 2,$33
BLK.W 2,$44
BLK.W 2,$55
blk.w 8,$BB
blk.w 6,$aa
blk.w 5,$99
blk.w 5,$88
blk.w 5,$77
blk.w 6,$66
blk.w 5,$55
blk.w 5,$44
blk.w 5,$33
blk.w 5,$22
blk.w 5,$11
Blk.w 50,0
endtab: dc.w $abcd,$abcd,$abcd,$abcd
gfxbase:
dc.l 0
oldcopper:
dc.l 0
newcopper:
dc.w $0100,$0000,$0180,0
dc.w $0108,$000,$010a,$000
dc.w $2c01,$fffe
DC.W $0100,$5200
DC.W $00E0,$0006,$00E4,$0006
dc.w $00e8,$0006,$00ec,$0006
dc.w $00f0,$0006
dc.w $00e2,$0000,$00e6,$2260
dc.w $00ea,$44c0,$00ee,$6720
dc.w $00f2,$8980
dc.w $0092,$0030,$0094,$00d8
dc.w $008e,$1e01,$0090,$3eff
dc.w $0180,$0000,$0182,$0002,$0184,$0300,$0186,$0400
dc.w $0188,$0004,$018a,$0500,$018c,$0005,$018e,$0006
dc.w $0190,$0700,$0192,$0007,$0194,$0008,$0196,$0810
dc.w $0198,$0009,$019a,$000a,$019c,$0920,$019e,$000b
dc.w $01a0,$000c,$01a2,$000d,$01a4,$0b30,$01a6,$000e
dc.w $01a8,$000f,$01aa,$0c40,$01ac,$0d50,$01ae,$0e60
dc.w $01b0,$0f90,$01b2,$0fa0,$01b4,$0fb0,$01b6,$0fc0
dc.w $01b8,$0fd0,$01ba,$0fe0,$01bc,$0ff0,$01be,$0fff
dc.w $d501,$fffe,$0100,$1200,$00e0,$0007
dc.w $0108,$0030,$010a,$0030
dc.w $0092,$0030,$0094,$00d8
dc.w $0182
xcols: dc.w $0FF0,$00e2
xbps: dc.w $a000,$0102
xscs: dc.w $0000
dc.w $d601,$fffe,$0182,$0FE0,$00e2,$a088,$0102,$0000
dc.w $d701,$fffe,$0182,$0FD0,$00e2,$a088,$0102,$0000
dc.w $d801,$fffe,$0182,$0FC0,$00e2,$a088,$0102,$0000
dc.w $d901,$fffe,$0182,$0FB0,$00e2,$a088,$0102,$0000
dc.w $da01,$fffe,$0182,$0FA0,$00e2,$a088,$0102,$0000
dc.w $db01,$fffe,$0182,$0F90,$00e2,$a088,$0102,$0000
dc.w $dc01,$fffe,$0182,$0F80,$00e2,$a088,$0102,$0000
dc.w $dd01,$fffe,$0182,$0F70,$00e2,$a088,$0102,$0000
dc.w $de01,$fffe,$0182,$0F60,$00e2,$a088,$0102,$0000
dc.w $df01,$fffe,$0182,$0F50,$00e2,$a088,$0102,$0000
dc.w $e001,$fffe,$0182,$0F30,$00e2,$a088,$0102,$0000
dc.w $e101,$fffe,$0182,$0F20,$00e2,$a088,$0102,$0000
dc.w $e201,$fffe,$0182,$0F10,$00e2,$a088,$0102,$0000
dc.w $e301,$fffe,$0182,$0F00,$00e2,$a088,$0102,$0000
dc.w $e401,$fffe,$0182
xcolf: dc.w $0F00,$00e2
xbpf: dc.w $0088,$0102
xscf: dc.w $0000
dc.w $7601,$fffe,$0182,$0202,$00e2,$8000,$0102,$0000
dc.w $0100,$0000
dc.w $f201,$fffe
dc.w $0100,$0000
pal: dc.w $ffdf,$fffe,$0021,$fffe
end: dc.w $ffff,$fffe
;*********************************
;* SoundTracker VI - Playroutine *
;* *
;* Improved by Unknown of D.O.C *
;* for SoundTracker IV and VI... *
;*********************************
mt_speed=$1f4
bsr.s mt_init
move.w #$4000,$dff09a
move.l $00006c,mt_oldirq+2
move.l #mt_newirq,$00006c
move.w #$c000,$dff09a
mt_wait:
btst #6,$bfe001
bne.s mt_wait
move.w #$000f,$dff096
move.w #$4000,$dff09a
move.l mt_oldirq+2,$00006c
move.w #$c000,$dff09a
clr.l d0
rts
mt_init:
move.l #mt_snd1,mt_sample1
move.l #mt_snd2,mt_sample2
move.l #mt_snd3,mt_sample3
move.l #mt_snd4,mt_sample4
move.l #mt_snd5,mt_sample5
move.l #mt_snd6,mt_sample6
move.l #mt_snd7,mt_sample7
move.l #mt_snd8,mt_sample8
move.l #mt_snd9,mt_sample9
move.l #mt_snda,mt_sample10
move.l #mt_sndb,mt_sample11
move.l #mt_sndc,mt_sample12
move.l #mt_sndd,mt_sample13
move.l #mt_snde,mt_sample14
move.l #mt_sndf,mt_sample15
move.l #mt_sample1,a0
clr.l d0
mt_clear:
move.l (a0,d0),a1
clr.l (a1)
addq #4,d0
cmp.l #$3c,d0
bne.s mt_clear
move.w #0,$dff0a8
move.w #0,$dff0b8
move.w #0,$dff0c8
move.w #0,$dff0d8
clr.l mt_partnrplay
clr.l mt_partnote
clr.l mt_partpoint
move.b mt_muzakdata+$1d6,mt_maxpart+1
move.b mt_muzakdata+$1d7,mt_kn1+1
rts
mt_newirq:
movem.l d0-d7/a0-a6,-(a7)
bsr.s mt_music
movem.l (a7)+,d0-d7/a0-a6
mt_oldirq:
jmp $000000
mt_music:
addq.l #1,mt_counter
mt_cool:
cmp.l #6,mt_counter
bne.s mt_notsix
clr.l mt_counter
bra mt_rout2
mt_notsix:
lea mt_aud1temp,a6
tst.b 3(a6)
beq.s mt_arp1
move.l #$dff0a0,a5
bsr.s mt_arprout
mt_arp1:
lea mt_aud2temp,a6
tst.b 3(a6)
beq.s mt_arp2
move.l #$dff0b0,a5
bsr.s mt_arprout
mt_arp2:
lea mt_aud3temp,a6
tst.b 3(a6)
beq.s mt_arp3
move.l #$dff0c0,a5
bsr.s mt_arprout
mt_arp3:
lea mt_aud4temp,a6
tst.b 3(a6)
beq.s mt_arp4
move.l #$dff0d0,a5
bra.s mt_arprout
mt_arp4:
rts
mt_arprout:
tst.w 24(a6)
beq.s mt_noslide
clr.w d0
move.b 25(a6),d0
lsr.b #4,d0
tst.b d0
beq.s mt_voldwn2
bsr mt_pushvol1
bra.s mt_noslide
mt_voldwn2:
clr.w d0
move.b 25(a6),d0
bsr mt_pushvol2
mt_noslide:
move.b 2(a6),d0
and.b #$0f,d0
tst.b d0
beq mt_arpegrt
cmp.b #3,d0
beq mt_arpegrt
cmp.b #4,d0
beq mt_arpegrt
cmp.b #5,d0
beq mt_arpegrt
cmp.b #1,d0
beq.s mt_portup
cmp.b #6,d0
beq.s mt_portup
cmp.b #7,d0
beq.s mt_portup
cmp.b #8,d0
beq.s mt_portup
cmp.b #2,d0
beq.s mt_portdwn
cmp.b #9,d0
beq.s mt_portdwn
cmp.b #10,d0
beq.s mt_portdwn
cmp.b #11,d0
beq.s mt_portdwn
cmp.b #13,d0
beq.s mt_volup
rts
mt_portup:
clr.w d0
move.b 3(a6),d0
sub.w d0,22(a6)
cmp.w #$71,22(a6)
bpl.s mt_ok1
move.w #$71,22(a6)
mt_ok1:
move.w 22(a6),6(a5)
rts
mt_portdwn:
clr.w d0
move.b 3(a6),d0
add.w d0,22(a6)
cmp.w #$358,22(a6)
bmi.s mt_ok2
move.w #$358,22(a6)
mt_ok2:
move.w 22(a6),6(a5)
rts
mt_volup:
clr.w d0
move.b 3(a6),d0
lsr.b #4,d0
tst.b d0
beq.s mt_voldwn
mt_pushvol1:
add.w d0,$12(a6)
cmp.w #$40,$12(a6)
bmi.s mt_ok3
move.w #$40,$12(a6)
mt_ok3:
move.w $12(a6),8(a5)
rts
mt_voldwn:
clr.w d0
move.b 3(a6),d0
mt_pushvol2:
and.b #$0f,d0
sub.w d0,$12(a6)
bpl.s mt_ok4
clr.w $12(a6)
mt_ok4:
move.w $12(a6),8(a5)
rts
mt_arpegrt:
cmp.l #1,mt_counter
beq.s mt_loop2
cmp.l #2,mt_counter
beq.s mt_loop3
cmp.l #3,mt_counter
beq.s mt_loop4
cmp.l #4,mt_counter
beq.s mt_loop2
cmp.l #5,mt_counter
beq.s mt_loop3
rts
mt_loop2:
clr.l d0
move.b 3(a6),d0
lsr.b #4,d0
bra.s mt_cont
mt_loop3:
clr.l d0
move.b 3(a6),d0
and.b #$0f,d0
bra.s mt_cont
mt_loop4:
move.w 16(a6),d2
bra.s mt_endpart
mt_cont:
lsl.w #1,d0
clr.l d1
move.w 16(a6),d1
lea mt_arpeggio,a0
mt_loop5:
move.w (a0,d0),d2
cmp.w (a0),d1
beq.s mt_endpart
addq.l #2,a0
bra.s mt_loop5
mt_endpart:
move.w d2,6(a5)
rts
mt_rout2:
lea mt_muzakdata,a0
move.l a0,a3
add.l #$0c,a3
move.l a0,a2
add.l #$1d8,a2
add.l #$258,a0
move.l mt_partnrplay,d0
clr.l d1
move.b (a2,d0),d1
mulu #$0400,d1
add.l mt_partnote,d1
move.l d1,mt_partpoint
clr.w mt_dmacon
move.l #$dff0a0,a5
lea mt_aud1temp,a6
bsr mt_playit
move.l #$dff0b0,a5
lea mt_aud2temp,a6
bsr mt_playit
move.l #$dff0c0,a5
lea mt_aud3temp,a6
bsr mt_playit
move.l #$dff0d0,a5
lea mt_aud4temp,a6
bsr mt_playit
move.l #mt_speed,d0
mt_rls:
dbf d0,mt_rls
move.l #$8000,d0
add.w mt_dmacon,d0
move.w d0,$dff096
move.l #mt_aud4temp,a6
cmp.w #1,14(a6)
bne.s mt_voice3
move.l 10(a6),$dff0d0
move.w #1,$dff0d4
mt_voice3:
move.l #mt_aud3temp,a6
cmp.w #1,14(a6)
bne.s mt_voice2
move.l 10(a6),$dff0c0
move.w #1,$dff0c4
mt_voice2:
move.l #mt_aud2temp,a6
cmp.w #1,14(a6)
bne.s mt_voice1
move.l 10(a6),$dff0b0
move.w #1,$dff0b4
mt_voice1:
move.l #mt_aud1temp,a6
cmp.w #1,14(a6)
bne.s mt_voice0
move.l 10(a6),$dff0a0
move.w #1,$dff0a4
mt_voice0:
move.l mt_partnote,d0
add.l #$10,d0
move.l d0,mt_partnote
cmp.l #$400,d0
bne.s mt_stop
clr.l mt_partnote
addq.l #1,mt_partnrplay
clr.l d0
move.w mt_maxpart,d0
move.l mt_partnrplay,d1
cmp.l d0,d1
bne.s mt_stop
clr.l mt_partnrplay
mt_stop:
rts
mt_playit:
move.l (a0,d1),(a6)
addq.l #4,d1
clr.l d2
move.b 2(a6),d2
and.b #$f0,d2
lsr.b #4,d2
tst.b d2
beq.s mt_nosamplechange
clr.l d3
lea mt_samples,a1
move.l d2,d4
mulu #4,d2
mulu #$1e,d4
move.l (a1,d2),4(a6)
move.w (a3,d4),8(a6)
move.w 2(a3,d4),18(a6)
move.w 4(a3,d4),d3
tst.w d3
beq.s mt_displace
move.l 4(a6),d2
add.l d3,d2
move.l d2,4(a6)
move.l d2,10(a6)
move.w 6(a3,d4),8(a6)
move.w 6(a3,d4),14(a6)
move.w 18(a6),8(a5)
bra.s mt_nosamplechange
mt_displace:
move.l 4(a6),d2
add.l d3,d2
move.l d2,10(a6)
move.w 6(a3,d4),14(a6)
move.w 18(a6),8(a5)
mt_nosamplechange:
tst.w (a6)
beq.s mt_retrout
move.w (a6),16(a6)
move.w 20(a6),$dff096
move.l 4(a6),(a5)
move.w 8(a6),4(a5)
move.w (a6),6(a5)
move.w 20(a6),d0
or.w d0,mt_dmacon
mt_retrout:
move.w 20(a6),d0
lsl.w #4,d0
add.w 20(a6),d0
move.w d0,$dff09e
tst.w (a6)
beq.s mt_nonewper
move.w (a6),22(a6)
mt_nonewper:
move.b 2(a6),d0
and.b #$0f,d0
cmp.b #14,d0
bne.s mt_noset
move.w 2(a6),24(a6)
rts
mt_noset:
tst.b 3(a6)
bne.s mt_noclr
clr.w 24(a6)
mt_noclr:
cmp.b #3,d0
beq.s mt_modvol
cmp.b #6,d0
beq.s mt_modvol
cmp.b #9,d0
beq.s mt_modvol
cmp.b #4,d0
beq.s mt_modper
cmp.b #7,d0
beq.s mt_modper
cmp.b #10,d0
beq.s mt_modper
cmp.b #5,d0
beq.s mt_modvolper
cmp.b #8,d0
beq.s mt_modvolper
cmp.b #11,d0
beq.s mt_modvolper
cmp.b #15,d0
beq.s mt_chgspeed
cmp.b #12,d0
bne.s mt_nochnge
move.b 3(a6),8(a5)
mt_nochnge:
rts
mt_chgspeed:
move.b 3(a6),d0
and.b #$0f,d0
beq.s mt_nochnge
clr.l mt_counter
move.b d0,mt_cool+5
rts
mt_modvol:
move.w 20(a6),d0
bra.s mt_push
mt_modper:
move.w 20(a6),d0
lsl.w #4,d0
bra.s mt_push
mt_modvolper:
move.w 20(a6),d0
lsl.w #4,d0
add.w 20(a6),d0
mt_push:
add.w #$8000,d0
move.w d0,$dff09e
rts
mt_aud1temp:
dc.w $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
dc.w $0000,$0000,$0001,$0000,$0000
mt_aud2temp:
dc.w $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
dc.w $0000,$0000,$0002,$0000,$0000
mt_aud3temp:
dc.w $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
dc.w $0000,$0000,$0004,$0000,$0000
mt_aud4temp:
dc.w $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
dc.w $0000,$0000,$0008,$0000,$0000
mt_partnote:
dc.l 0
mt_partnrplay:
dc.l 0
mt_counter:
dc.l 0
mt_partpoint:
dc.l 0
mt_samples:
dc.w $0000,$0000
mt_sample1:
dc.l 0
mt_sample2:
dc.l 0
mt_sample3:
dc.l 0
mt_sample4:
dc.l 0
mt_sample5:
dc.l 0
mt_sample6:
dc.l 0
mt_sample7:
dc.l 0
mt_sample8:
dc.l 0
mt_sample9:
dc.l 0
mt_sample10:
dc.l 0
mt_sample11:
dc.l 0
mt_sample12:
dc.l 0
mt_sample13:
dc.l 0
mt_sample14:
dc.l 0
mt_sample15:
dc.l 0
mt_maxpart:
dc.w $0000
mt_kn1:
dc.w $0000
mt_dmacon:
dc.w $0000
mt_arpeggio:
dc.w $0358,$0328,$02fa,$02d0,$02a6,$0280,$025c
dc.w $023a,$021a,$01fc,$01e0,$01c5,$01ac,$0194,$017d
dc.w $0168,$0153,$0140,$012e,$011d,$010d,$00fe,$00f0
dc.w $00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0,$0097
dc.w $008f,$0087,$007f,$0078,$0071,$0000,$0000,$0000
mt_snd1: blk.b 3000,0
mt_snd2: blk.b 3400,0
mt_snd3: blk.b 3000,0
mt_snd4: blk.b 4800,0
mt_snd5: blk.b 8900,0
mt_snd6: blk.b 9900,0
mt_snd7: blk.b 9400,0
mt_snd8: blk.b 2000,0
mt_snd9: blk.b 5000,0
mt_snda: blk.b 2000,0
mt_sndb: blk.b 9200,0
mt_sndc: blk.b 6900,0
mt_sndd: blk.b 9900,0
mt_snde: blk.b 5300,0
mt_sndf: blk.b 1200,0
mt_muzakdata: blk.b 20000,0